refactor(stm): cache the circuit test fixtures on disk - #3481
Merged
hjeljeli32 merged 9 commits intoAug 20, 2026
Merged
Conversation
hjeljeli32
requested review from
curiecrypt,
damrobi and
jpraynaud
as code owners
August 17, 2026 01:13
damrobi
reviewed
Aug 19, 2026
damrobi
left a comment
Collaborator
There was a problem hiding this comment.
Some none blocking comments but otherwise it looks good 👍
hjeljeli32
force-pushed
the
hjeljeli32/3462-extend-on-disk-cache-recursive-circuit-fixtures
branch
from
August 20, 2026 04:07
500c53b to
27ce251
Compare
hjeljeli32
deleted the
hjeljeli32/3462-extend-on-disk-cache-recursive-circuit-fixtures
branch
August 20, 2026 08:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content
This PR extends the content-keyed
FileMutexcache introduced by #3433 to both circuit test trees, which had none. Under the nextest process-per-test model an in-process cache amortizes nothing, so the SRS, the derived recursive verifying key, the certificate circuit keys and the deterministic 3000-signer fixture are now computed once per fingerprint and shared across test processes and runs.Measured locally:
circuits::halo2_ivcslow tier 435 s → 381 s,circuits::halo2slow tier 50 s → 44 s (−12 % each, ±8 s run to run). Numbers per ticket item are in #3462.Changes
halo2_ivc/tests/common/generators/setup.rs):build_shared_recursive_contextreads the degree-19 SRS from the same"unsafe-srs"entryIvcSnarkProverSetup::build_for_testwrites, both deriving from the same seed. A compile-time assertion tiesASSET_SEEDtoUNSAFE_SRS_SEED, so a change to either cannot silently alter the committed assets.halo2/tests/golden/helpers.rs): the process-localLazyLockmap is replaced by the on-diskKeyProvider, behind the cache lock so parallel processes racing a cold miss derive the pair once. The SRS asset filename now carries the seed that produced it, so a seed change cannot pair an old SRS with keys fingerprinted for a new one.AssetGenerationSetupis a pure function of them and is recomputed on both paths, so the two cannot disagree. Validated on load — vector lengths, plus the genesis signature verified against the message derived from the cached tree, which transitively covers tampering with the tree, the key or the signature.Pre-submit checklist
Issue(s)
Closes #3462